<?php

class Consts {
    /**
     * 常量类 类名简化Constants ->  Consts
     * @author liuhui 2009-6-12
     * aiikei@hotmail.com
     */
    # 动态常量 根椐环境的变化配置
    const LEVEL = 'development';
    
    # 是否实现DAO抛错
    const EXCEP = TRUE;
    const D_EXCEP = '';
    
    # 固定常量 不会改变的常量 如字段名
    # D -> DEFAULT 表示默认的自定义常量前缀
    # F -> FIELDS 表示默认的字段前缀
    const D_DEVELOPMENT = 'development';
    const D_PRODUCTION = 'production';
    const F_DBHOST = 'dbhost';
    const F_DBUSER = 'dbuser';
    const F_DBPASS = 'dbpass';
    const F_DBNAME = 'dbname';
    
    # 数据表字段前缀
    const F_CID = 'cid';
    const F_TITLE = 'title';
    const F_DESCRIPTION = 'description';
    const F_PRIVACY = 'privacy';
    const F_PICTURE = 'picture';
    const F_DISPLAYORDER = 'displayorder';
    const F_ID = 'id';
    const F_NAME = 'name';
    const F_URL = 'url';
    const F_STATUS = 'status';
    const F_VISIBLE = 'visible';
    const F_CLICKED = 'clicked';
    const F_TARGET = 'target';
    const F_UID = 'uid';
    const F_CREATE_AT = 'created_at';
    const F_UPDATE_AT = 'update_at';
    
    # 数据表名
    const T_CATEGORYS = 'categorys';
    const T_LINKS = 'links';

    # links表数据字段
    public static function FIELDS_LINKS () {
        return array(Consts::F_ID, Consts::F_CID, Consts::F_NAME, Consts::F_URL, 
            Consts::F_DESCRIPTION, Consts::F_STATUS, Consts::F_VISIBLE, 
            Consts::F_CLICKED, Consts::F_TARGET, Consts::F_PICTURE, 
            Consts::F_DISPLAYORDER, Consts::F_UID);
    }

    # category表数据字段
    public static function FIELDS_CATEGORYS () {
        return array(Consts::F_CID, Consts::F_TITLE, Consts::F_DESCRIPTION, 
            Consts::F_PRIVACY, Consts::F_PICTURE, Consts::F_DISPLAYORDER);
    }

}
?>